/**
 * @file   log.h
 * @Author Alexandre Chassany (alexandre.chassany@gmail.com)
 * @date   February 2011
 * @brief  Logging macro.
 * @details A bunch of macro wich may be used to log in an easy way in your
 * application. You can easily disable the log by defining NLOG in your
 * compilation target.
 *
 * Poum-tchak is a free sound manipulation and synthesis, 
 * real-time and interactive music-clip rendering.
 *
 * Copyright (C) 2011  Chassany Alexandre and Gonzalez Antoine.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * he Free Software Foundation, either version 3 of the License, or
 * at your option) any later version.
 *
 * is program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef _ELIXIR_LOG_H_
#define _ELIXIR_LOG_H_

#include <core/singleton.h>
#include <core/loggerholder.h>
#include <core/loggerconsole.h>
#include <core/loggerfile.h>

/**
 * Define the global logger of the application. Add / remove / change
 * loggers by updating the template specification.
 * @see typelist.h
 */
typedef Elixir::LoggerHolder<TYPELIST_2( Elixir::LoggerConsole, Elixir::LoggerFile )> GlobalLogHolder;

/**
 * 
 */
//#define NLOG
#ifdef NLOG
#define LX_LOG(msg)
#define LX_ERROR(msg)
#define LX_WARN(msg)
#else
#define LX_LOG(msg) (*Elixir::Singleton<GlobalLogHolder >::Instance()) << msg;
#define LX_ERROR(msg) (*Elixir::Singleton<GlobalLogHolder >::Instance()) << "ERROR> " << msg;
#define LX_WARN(msg) (*Elixir::Singleton<GlobalLogHolder >::Instance()) << "WARNING> " << msg;
#endif

#endif // _ELIXIR_LOG_H_
